import socket
# 创建socket对象
sk = socket.socket()
# 绑定IP和端口
sk.bind(("127.0.0.1",8080))
# 监听有没有服务器通信
sk.listen()
# 接收连接地址  阻塞 等待客户端开启
conn,addr = sk.accept()

conn.send("".encode("utf-8"))

msg = conn.recv(100)

# print("客户端收到消息：" + msg)

print(msg.decode("utf-8"))

conn.close()

sk.close()